package com.deke.order.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.deke.entity.EduVideo;
import com.deke.entity.TbPlayHistory;
import com.deke.order.service.TbPlayHistoryService;
import com.deke.vo.Result;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：陈昂（731712841@qq.com）
 * @date ：Created in 2023/1/4 20:03
 * @description：\
 * @modified By：
 * @version:
 */
@RestController
@RequestMapping("/order/play-history")
@Api(tags = "学习记录接口")
public class TbPlayHistoryController {

    @Autowired
    private TbPlayHistoryService tbPlayHistoryService;

    @ApiOperation(value = "分页查询")
    @ApiImplicitParams({
            @ApiImplicitParam(value = "页码", name = "currentPage"),
            @ApiImplicitParam(value = "当页数量", name = "pageCount"),
            @ApiImplicitParam(value = "会员id", name = "sessionStorage")
    })
    @PostMapping ("/queryPlayHistoryBy/{currentPage}/{pageCount}/{sessionStorage}")
    public Result<IPage<EduVideo>>  queryPlayHistoryBy(@PathVariable(required = true) Integer currentPage,
                                                            @PathVariable(required = true) Integer pageCount,
                                                            @PathVariable(required = true) String sessionStorage) {

        return tbPlayHistoryService.queryTbPlayHistoryid(currentPage,pageCount,sessionStorage);
    }

}
